package top.shiyiri.shops.controller;

import com.alibaba.fastjson.JSONObject;
import top.shiyiri.shops.bean.EraCount;
import top.shiyiri.shops.service.EraTotalCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author Aunean
 * @date 2021/12/23
 */
@Controller
public class EraTotalCountController {

    @Autowired
    private EraTotalCountService service;

    @ResponseBody
    @RequestMapping("/earTotalCount")
    public String earTotalCount() {

        List<EraCount> list = service.earTotalCount();
        String jsonArr = JSONObject.toJSONString(list);

        return jsonArr;
    }
}
